package com.gxedu.springenvironmentconfig.profile;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @Auther: Liu_gx
 * @Date: 2021/1/28 16:29
 * @Description:
 */
public class ProfileMain {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
        context.getEnvironment().setActiveProfiles("prd");
        context.register(ProfileConfig.class);
        context.refresh();
        ProfileService bean = context.getBean(ProfileService.class);
        System.out.println(bean);
    }
}
